const express = require("express");
const router = express.Router();

const expressJoi = require("@escook/express-joi");
const {
  add_cate_schema,
  delete_get_cate_schema,
  update_cate_schema,
} = require("../schema/artcate");

const {
  getArticleCates,
  addArticleCates,
  deleteCateById,
  getArticleById,
  updateCateById,
} = require("../router_handler/artcate");

router.get("/cates", getArticleCates);
router.post("/addcates", expressJoi(add_cate_schema), addArticleCates);
router.get(
  "/deletecate/:id",
  expressJoi(delete_get_cate_schema),
  deleteCateById
);
router.get("/cates/:id", expressJoi(delete_get_cate_schema), getArticleById);
router.post("/updatecate", expressJoi(update_cate_schema), updateCateById);
module.exports = router;
